package com.example.demo.user.service;

import com.example.demo.user.entity.User;
import com.example.demo.user.mapper.IUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ******************************************************
 *
 * @author liugh9
 * @version 1.0
 * @classname UserService
 * @description
 * @date 2024/03/19 22:01
 * <p>
 * ******************************************************
 */
@Service
public class UserService {

    @Autowired
    private IUserMapper userRepository;

    public String getUserRole(String username) {
        User user = userRepository.findByUsername(username);
        if (user != null) {
            return user.getAge();
        }
        return null;
    }
}
